unit cataurus.nwn.language.frLanguageAdd;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, JvExStdCtrls, JvHtControls, ComCtrls, JvExComCtrls,
  JvStatusBar, JvExControls, JvgWizardHeader, JvMemo, JvEdit, cataurus.nwn;

type
  TfrLanguageAdd = class(TForm)
    JvgWizardHeader1: TJvgWizardHeader;
    JvHTComboBox1: TJvHTComboBox;
    eTitel: TJvEdit;
    eURL: TJvEdit;
    eBeschreibung: TJvMemo;
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure FormShow(Sender: TObject);
    procedure JvHTComboBox1Change(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

procedure Execute_FrLanguageAdd( Hak : TComponent);

implementation

{$R *.dfm}

uses cataurus.nwn.def;

procedure Execute_FrLanguageAdd( Hak : TComponent);
var
  frLanguageAdd: TfrLanguageAdd;
begin
  frLanguageAdd := TfrLanguageAdd.Create(nil);
  try
    if mrOK = frLanguageAdd.ShowModal then
    begin
      (Hak as THak).Language.Add(
         StringToLanguageID(
             frLanguageAdd.JvHTComboBox1.Items[
                        frLanguageAdd.JvHTComboBox1.ItemIndex]
                           ),
          AnsiString(frLanguageAdd.eTitel.Text),
          AnsiString(frLanguageAdd.eURL.Text),
          AnsiString(frLanguageAdd.eBeschreibung.Lines.Text)
                                );
    end;
  finally
    frLanguageAdd.Free;
  end;
end;


procedure TfrLanguageAdd.FormShow(Sender: TObject);
var
  i : integer;
begin
  JvHTComboBox1.Items.Clear;
  for I := Low(SprachRec) to High(SprachRec) do
  begin
    JvHTComboBox1.Items.Add(SprachRec[i].Sprache);
  end;
end;

procedure TfrLanguageAdd.JvHTComboBox1Change(Sender: TObject);
begin
  eTitel.Enabled := true;
  eURL.Enabled := true;
  eBeschreibung.Enabled := true;
end;

end.
